#include <Unit.h>

Unit::Unit(const UnitAttribute & unitInitPara)
:coefficient(unitInitPara.coefficient), unitName(unitInitPara.unitName)
{
        for (unsigned int i = 0;  i < MAX_UNIT_PRINT_MODE; i ++)
        {
                this->printModeArray[i] = unitInitPara.printModeArray[i];
        }
}

unsigned int Unit::getUnitCoefficient() const
{
        return coefficient;
}

bool Unit::operator<=(const Unit &other) const
{
	return coefficient <= other.coefficient;
}

bool Unit::operator>(const Unit &other) const
{
        return coefficient > other.coefficient;
}

const char* Unit::getUnitName() const
{
	return unitName;
}

unsigned int  Unit::getPrintFlag(unsigned int mode) const
{
	return printModeArray[mode];
}
